﻿import React, {Component} from 'react';
import axios from 'axios'
import DingdanList from '../../components/dingdan/dingdanList'
import {queryGroupOrder,} from '../../utils/api'

class Pintuanliebiao extends Component {
    constructor() {
        super();
        this.state={
            data:'暂无数据'
        }
    }
    componentDidMount() {
        this.tuandanData({})
    }
    tuandanData=(val)=>{
        axios({
            url:queryGroupOrder,
            method:'get',
            params:val
        }).then(data=>{
            console.log(data)
            if (data.data.code===200){
                this.setState({
                    data:data.data.data
                })
            }else{
                this.setState({
                    data:'暂无数据'
                })
            }
        })
    }

    searchData=(e)=>{
        console.log(e)
        this.tuandanData(e)
    }
    render() {
        // console.log(this.props)
        return (
            <div>
                <DingdanList.TuandanSaiXuan search={this.searchData}/>
                <DingdanList.TuandanLieBiao data={this.state.data}/>
            </div>
        );
    }
}

export default Pintuanliebiao;